package net.hxz.modules.controller.backEnd;

import net.hxz.modules.controller.BaseController;
import net.hxz.modules.pojo.Text;
import net.hxz.modules.services.ITextService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("backEnd/text/")
public class BackEndTextController extends BaseController{
	private final String PATH = "backEnd/modules/text/";
	
	@Autowired
	private ITextService textService;
    
    @RequestMapping("mod")
    public String mod(Long textId, ModelMap map) {
    	map.put("text", textService.get(textId));
        return PATH + "mod";
    }
	
	@RequestMapping(value = "/mod.json")
	public void mod( Text text, ModelMap map) {
		textService.mod(text);
	}
}

